home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Action Arcade 1997
/
Action Arcade 1997.iso
/
ps
/
unit16.pas
< prev
Wrap
Pascal/Delphi Source File
|
1996-12-17
|
4KB
|
154 lines
unit Unit16;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, DdeMan, StdCtrls, Buttons, FileCtrl, Gauges, ExtCtrls,fs;
type
TForm1 = class(TForm)
Panel1: TPanel;
Image2: TImage;
Image1: TImage;
RCD: TImage;
Image3: TImage;
Image4: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
ben: TGauge;
ScrollBox1: TScrollBox;
Image5: TImage;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
flb1: TFileListBox;
flb2: TFileListBox;
flb3: TFileListBox;
dr: TComboBox;
BitBtn1: TBitBtn;
ComboBox1: TComboBox;
DdeClient: TDdeClientConv;
procedure Image3MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Image3MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Image4Click(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure BitBtn1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
i:integer;
macro,name,s:string;
cmd:array[0..255] of char;
implementation
{$R *.DFM}
procedure TForm1.Image3MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
image3.visible:=false;
end;
procedure TForm1.Image3MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
image3.visible:=true;
strpcopy(cmd,s+'\'+flb2.items[0]);
winexec(cmd,SW_ShowNormal);
end;
procedure TForm1.Image4Click(Sender: TObject);
begin
close;
end;
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
s:=combobox1.text;
s:='\games\'+s;
flb1.directory:=s;
flb2.directory:=s;
flb3.directory:=s;
if flb1.items.count-1<0 then
image5.picture.loadfromfile('\ps.bmp')
else
image5.picture.loadfromfile(s+'\'+flb1.items[0]);
end;
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
IMAGE1.VISIBLE:=FALSE;
end;
procedure TForm1.Image1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
IMAGE1.VISIBLE:=TRUE;
dr.visible:=true;
height:=464;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
try
caption:=dr.text+s;
mkdir(dr.text+'\games')
except
try mkdir(dr.text+s)
finally {}
end;
end;
if s<>'' then
begin
for i:=0 to flb3.items.count-1 do
Begin
ben.visible:=true;
ben.progress:=round(i*100/(flb3.items.count-1));
copyfile(s+'\'+flb3.items[i],dr.text+s);
End;
ben.visible:=false;
begin
Name := 'Games';
Macro := Format('[CreateGroup(%s)]', [Name]) + #13#10;
StrPCopy (Cmd, Macro);
DDEClient.OpenLink;
if not DDEClient.ExecuteMacro(Cmd, False) then
MessageDlg('Unable to create group.', mtInformation, [mbOK], 0);
Macro := Format('[Additem(%s)]', [s+'\'+flb2.items[0]+','+combobox1.text+','+s+'\'+flb2.items[0]])+ #13#10;
StrPCopy (Cmd, Macro);
if not DDEClient.ExecuteMacro(Cmd, False) then
MessageDlg('Unable to Add Item.', mtInformation, [mbOK], 0);
DDEClient.CloseLink;
end;
height:=401;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
flb2.directory:='\games';
end;
end.